<template>
<div>
  <div class="layout">
    <div class="register-container">
      <Subtitle :text="$t('registerConfirm.title')" />
      <div class="register-confirm">
        <div class="subtitle">{{ $t('registerConfirm.register') }}</div>
        <div class="confirm-details">{{ $t('registerConfirm.registerDescription') }}</div>
        <div class="email">{{ $t('registerConfirm.email') }}</div>
      </div>
      <div class="primary-button m-t-60" @click="handleButtonClick">{{ $t('registerConfirm.buttonBegin') }}</div>
      <div class="agreement">
        <input type="checkbox" v-model="checkbox">
        <i18n class="agreement-text" path="registerConfirm.agreement">
          <a place="privacy" target="_blank" href="https://www.intel.cn/content/www/cn/zh/privacy/intel-privacy-notice.html">{{ $t('registerConfirm.privacy') }}</a>
          <a place="terms" target="_blank" href="https://www.intel.cn/content/www/cn/zh/legal/terms-of-use.html">{{ $t('registerConfirm.terms') }}</a>
        </i18n>
      </div>

    </div>
  </div>
  <Alert v-if="alertShow" @ok="() => alertShow = false" :content="alertContent"/>
</div>
</template>

<script>
import IntelInput from "../../components/common/IntelInput";
import Subtitle from "../../components/common/Subtitle";
import {getUserInfo, register, validEmail} from "../../api/service";
import Alert from "../../components/common/Alert";

export default {
  name: "faq",
  components: {
    IntelInput,
    Subtitle,
    Alert
  },
  data () {
    return {
      checkbox: false,
      alertShow: false,
      alertContent: '请先勾选同意后在进行开始'
    }
  },
  methods: {
    handleButtonClick () {
      if (this.checkbox) {
        this.$router.push({
          path: this.$i18n.path('nameConfirm')
        })
      } else {
        this.alertShow = true
      }
    }
  }
}
</script>

<style scoped>
.register-container {
  width: 800px;
  padding-top: 60px;
  padding-left: 120px;
  padding-bottom: 120px;
}
.create-text .title {
  font-weight: bold;
  font-size: 20px;
  color: #0068B5;
  padding-bottom: 18px;
}
.create-text .desc {
  font-size: 14px;
  color: #999999;
}

.create-text .desc a {
  color: #0068B5;
  text-decoration: none;
}
.register-confirm {

}
.register-confirm .subtitle {
  font-weight: bold;
  font-size: 20px;
  color: #0068B5;
}
.primary-button {
  width: 146px;
  height: 36px;
  color: white;
  font-size: 14px;
  text-align: center;
  line-height: 36px;
  background: #0068B5;
  cursor: pointer;
  margin-top: 16px;
}

.confirm-details {
  font-size: 14px;
  color: #999999;
  margin-top: 18px;
  white-space: pre-line;
}

.m-t-60 {
  margin-top: 60px;
}

.agreement {
  display: flex;
  margin-top: 22px;
}
.agreement > .agreement-text {
  font-size: 14px;
  color: #999999;
}
.agreement > .agreement-text > span,
.email {
  font-size: 14px;
  color: #0068B5;
}
.agreement > input {
  margin-right: 8px;
}
</style>
